package com.xmfh.wemedia.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xmfh.wemedia.model.DdAlbum;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 相册表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2022-04-03
 */
@Mapper
public interface DdAlbumMapper extends BaseMapper<DdAlbum> {

    /**
     * 获取个人主页中相册分页内容
     *
     * @param id 目前登陆用户ID
     * @return 个人主页中相册分页内容集合
     */
    List<DdAlbum> getPersonalAlbumById(Integer id);

    @Insert("Insert into dd_album values(null,#{title},#{desc},#{fabulous},#{comment},#{views},#{hot},#{user_id},#{category_id})")


    /**
     * 获取相册信息
     *
     * @param id
     * @return 获取相册的信息
     */
    @Select("select * from dd_album where id = #{id}")
    public List<DdAlbum> getAlbumInfo(int id);

}
